## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

# Adapted from:

# Makefile for PO directory in any package using GNU gettext.
# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file can be copied and used freely without restrictions.  It can
# be used in projects which are not available under the GNU General Public
# License but which still want to provide support for the GNU gettext
# functionality.
# Please note that the actual code of GNU gettext is covered by the GNU
# General Public License and is *not* in the public domain.
#
# Origin: gettext-0.14.4

PACKAGE = cds-invenio
VERSION = 0.99.90.20100201
PACKAGE_BUGREPORT = cds.support@cern.ch

SHELL = /bin/sh


srcdir = .
top_srcdir = ..


prefix = /opt/cds-invenio
exec_prefix = ${prefix}
datadir = ${prefix}/share
localedir = $(datadir)/locale
gettextsrcdir = $(datadir)/gettext/po

INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
mkinstalldirs = ${SHELL} /home/lebaoanh/workspace/cds-invenio/install-sh -d

GMSGFMT = /usr/bin/msgfmt
MSGFMT = /usr/bin/msgfmt
XGETTEXT = /usr/bin/xgettext
MSGMERGE = msgmerge
MSGMERGE_UPDATE = /usr/bin/msgmerge --update
MSGINIT = msginit
MSGCONV = msgconv
MSGFILTER = msgfilter

POFILES =  af.po bg.po ca.po cs.po de.po el.po en.po es.po fr.po hr.po hu.po gl.po it.po ja.po no.po pl.po pt.po ro.po ru.po rw.po sk.po sv.po uk.po zh_CN.po zh_TW.po
GMOFILES =  af.gmo bg.gmo ca.gmo cs.gmo de.gmo el.gmo en.gmo es.gmo fr.gmo hr.gmo hu.gmo gl.gmo it.gmo ja.gmo no.gmo pl.gmo pt.gmo ro.gmo ru.gmo rw.gmo sk.gmo sv.gmo uk.gmo zh_CN.gmo zh_TW.gmo
UPDATEPOFILES =  af.po-update bg.po-update ca.po-update cs.po-update de.po-update el.po-update en.po-update es.po-update fr.po-update hr.po-update hu.po-update gl.po-update it.po-update ja.po-update no.po-update pl.po-update pt.po-update ro.po-update ru.po-update rw.po-update sk.po-update sv.po-update uk.po-update zh_CN.po-update zh_TW.po-update
DUMMYPOFILES =  af.nop bg.nop ca.nop cs.nop de.nop el.nop en.nop es.nop fr.nop hr.nop hu.nop gl.nop it.nop ja.nop no.nop pl.nop pt.nop ro.nop ru.nop rw.nop sk.nop sv.nop uk.nop zh_CN.nop zh_TW.nop
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
DISTFILES = $(DISTFILES.common) POTFILES.in \
$(POFILES) $(GMOFILES) \
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)

PYTHON = /usr/bin/python

POTFILES = \
     ../modules/webhelp/web/help-central.webdoc \
     ../modules/webhelp/web/admin/admin.webdoc \
     ../modules/websearch/doc/search-tips.webdoc \
     ../modules/websearch/doc/search-guide.webdoc \
     ../modules/websearch/doc/admin/websearch-admin-guide.webdoc \
     ../modules/websubmit/doc/submit-guide.webdoc \
     ../modules/websubmit/doc/admin/websubmit-admin-guide.webdoc \
     ../modules/bibedit/doc/admin/bibedit-admin-guide.webdoc \
     ../modules/bibupload/doc/admin/bibupload-admin-guide.webdoc \
     ../modules/bibformat/doc/admin/bibformat-admin-guide.webdoc \
     ../modules/bibharvest/doc/admin/bibharvest-admin-guide.webdoc \
     ../modules/webmessage/doc/admin/webmessage-admin-guide.webdoc \
     ../modules/webalert/doc/admin/webalert-admin-guide.webdoc \
     ../modules/bibclassify/doc/admin/bibclassify-admin-guide.webdoc \
     ../modules/bibmatch/doc/admin/bibmatch-admin-guide.webdoc \
     ../modules/bibconvert/doc/admin/bibconvert-admin-guide.webdoc \
     ../modules/bibsched/doc/admin/bibsched-admin-guide.webdoc \
     ../modules/bibrank/doc/admin/bibrank-admin-guide.webdoc \
     ../modules/webstat/doc/admin/webstat-admin-guide.webdoc \
     ../modules/bibindex/doc/admin/bibindex-admin-guide.webdoc \
     ../modules/webbasket/doc/admin/webbasket-admin-guide.webdoc \
     ../modules/webcomment/doc/admin/webcomment-admin-guide.webdoc \
     ../modules/websession/doc/admin/websession-admin-guide.webdoc \
     ../modules/webstyle/doc/admin/webstyle-admin-guide.webdoc \
     ../modules/webstyle/doc/hacking/webstyle-webdoc-syntax.webdoc \
     ../modules/elmsubmit/doc/admin/elmsubmit-admin-guide.webdoc \
     ../modules/bibformat/etc/format_templates/Default_HTML_files.bft \
     ../modules/bibformat/etc/format_templates/Default_HTML_actions.bft \
     ../modules/bibconvert/bin/bibconvert.in \
     ../modules/bibconvert/lib/bibconvert.py \
     ../modules/bibconvert/lib/bibconvert_tests.py \
     ../modules/bibedit/bin/refextract.in \
     ../modules/bibedit/bin/xmlmarclint.in \
     ../modules/bibedit/lib/bibedit_engine.py \
     ../modules/bibedit/lib/bibedit_templates.py \
     ../modules/bibedit/lib/bibrecord_config.py \
     ../modules/bibedit/lib/bibrecord.py \
     ../modules/bibedit/lib/bibrecord_tests.py \
     ../modules/bibedit/lib/refextract_config.py \
     ../modules/bibedit/lib/refextract.py \
     ../modules/bibedit/web/admin/bibeditadmin.py \
     ../modules/bibformat/bin/bibreformat.in \
     ../modules/bibformat/lib/bibformat_engine_tests.py \
     ../modules/bibformat/lib/bibformat_templates.py \
     ../modules/bibformat/lib/bibformatadminlib.py \
     ../modules/bibformat/lib/elements/bfe_authors.py \
     ../modules/bibformat/lib/elements/bfe_fulltext.py \
     ../modules/bibformat/lib/elements/bfe_fulltext_mini.py \
     ../modules/bibformat/web/admin/bibformatadmin.py \
     ../modules/bibharvest/bin/oaiharvest.in \
     ../modules/bibharvest/lib/bibharvest_templates.py \
     ../modules/bibindex/bin/bibindex.in \
     ../modules/bibindex/bin/bibstat.in \
     ../modules/bibindex/lib/bibindexadminlib.py \
     ../modules/bibindex/lib/bibindex_engine_config.py \
     ../modules/bibindex/lib/bibindex_engine.py \
     ../modules/bibindex/lib/bibindex_engine_stemmer.py \
     ../modules/bibindex/lib/bibindex_engine_stemmer_tests.py \
     ../modules/bibindex/lib/bibindex_engine_stopwords.py \
     ../modules/bibindex/lib/bibindex_engine_tests.py \
     ../modules/bibindex/web/admin/bibindexadmin.py \
     ../modules/bibrank/bin/bibrankgkb.in \
     ../modules/bibrank/bin/bibrank.in \
     ../modules/bibrank/lib/bibrankadminlib.py \
     ../modules/bibrank/lib/bibrank_citation_grapher.py \
     ../modules/bibrank/lib/bibrank_citation_indexer.py \
     ../modules/bibrank/lib/bibrank_citation_indexer_tests.py \
     ../modules/bibrank/lib/bibrank_citation_searcher.py \
     ../modules/bibrank/lib/bibrank_citation_searcher_tests.py \
     ../modules/bibrank/lib/bibrank_downloads_grapher.py \
     ../modules/bibrank/lib/bibrank_downloads_indexer.py \
     ../modules/bibrank/lib/bibrank_downloads_indexer_tests.py \
     ../modules/bibrank/lib/bibrank_downloads_similarity.py \
     ../modules/bibrank/lib/bibrank_grapher.py \
     ../modules/bibrank/lib/bibrank_record_sorter.py \
     ../modules/bibrank/lib/bibrank_record_sorter_tests.py \
     ../modules/bibrank/lib/bibrank_tag_based_indexer.py \
     ../modules/bibrank/lib/bibrank_tag_based_indexer_tests.py \
     ../modules/bibrank/lib/bibrank_word_indexer.py \
     ../modules/bibrank/web/admin/bibrankadmin.py \
     ../modules/bibsched/bin/bibsched.in \
     ../modules/bibsched/bin/bibtaskex.in \
     ../modules/elmsubmit/bin/elmsubmit.in \
     ../modules/elmsubmit/lib/elmsubmit_enriched2txt.py \
     ../modules/elmsubmit/lib/elmsubmit_EZArchive.py \
     ../modules/elmsubmit/lib/elmsubmit_EZEmail.py \
     ../modules/elmsubmit/lib/elmsubmit_field_validation.py \
     ../modules/elmsubmit/lib/elmsubmit_filename_generator.py \
     ../modules/elmsubmit/lib/elmsubmit_html2txt.py \
     ../modules/elmsubmit/lib/elmsubmit_misc.py \
     ../modules/elmsubmit/lib/elmsubmit.py \
     ../modules/elmsubmit/lib/elmsubmit_richtext2txt.py \
     ../modules/elmsubmit/lib/elmsubmit_submission_parser.py \
     ../modules/elmsubmit/lib/myhtmlentitydefs.py \
     ../modules/miscutil/bin/dbexec.in \
     ../modules/miscutil/lib/dateutils.py \
     ../modules/miscutil/lib/errorlib.py \
     ../modules/miscutil/lib/errorlib_tests.py \
     ../modules/miscutil/lib/errorlib_webinterface.py \
     ../modules/miscutil/lib/__init__.py \
     ../modules/miscutil/lib/inveniocfg.py \
     ../modules/miscutil/lib/miscutil_config.py \
     ../modules/miscutil/lib/mailutils.py \
     ../modules/miscutil/lib/messages.py \
     ../modules/miscutil/lib/textutils.py \
     ../modules/webaccess/bin/authaction.in \
     ../modules/webaccess/bin/webaccessadmin.in \
     ../modules/webaccess/lib/access_control_admin.py \
     ../modules/webaccess/lib/access_control_config.py \
     ../modules/webaccess/lib/access_control_engine.py \
     ../modules/webaccess/lib/external_authentication.py \
     ../modules/webaccess/lib/webaccessadmin_lib.py \
     ../modules/webaccess/web/admin/webaccessadmin.py \
     ../modules/webalert/bin/alertengine.in \
     ../modules/webalert/lib/alert_engine.py \
     ../modules/webalert/lib/htmlparser.py \
     ../modules/webalert/lib/webalert.py \
     ../modules/webalert/lib/webalert_templates.py \
     ../modules/webalert/lib/webalert_webinterface.py \
     ../modules/webbasket/lib/webbasket.py \
     ../modules/webbasket/lib/webbasket_config.py \
     ../modules/webbasket/lib/webbasket_templates.py \
     ../modules/webbasket/lib/webbasket_webinterface.py \
     ../modules/webcomment/lib/webcommentadminlib.py \
     ../modules/webcomment/lib/webcomment_config.py \
     ../modules/webcomment/lib/webcomment.py \
     ../modules/webcomment/lib/webcomment_templates.py \
     ../modules/webcomment/lib/webcomment_tests.py \
     ../modules/webcomment/lib/webcomment_webinterface.py \
     ../modules/webcomment/web/admin/webcommentadmin.py \
     ../modules/webmessage/bin/webmessageadmin.in \
     ../modules/webmessage/lib/webmessage_config.py \
     ../modules/webmessage/lib/webmessage_dblayer.py \
     ../modules/webmessage/lib/webmessage_mailutils.py \
     ../modules/webmessage/lib/webmessage.py \
     ../modules/webmessage/lib/webmessage_templates.py \
     ../modules/webmessage/lib/webmessage_webinterface.py \
     ../modules/websearch/bin/webcoll.in \
     ../modules/websearch/lib/search_engine_config.py \
     ../modules/websearch/lib/search_engine.py \
     ../modules/websearch/lib/search_engine_tests.py \
     ../modules/websearch/lib/websearchadminlib.py \
     ../modules/websearch/lib/websearch_templates.py \
     ../modules/websearch/lib/websearch_webinterface.py \
     ../modules/websearch/lib/websearch_external_collections.py \
     ../modules/websearch/lib/websearch_external_collections_templates.py \
     ../modules/websearch/lib/websearch_webcoll.py \
     ../modules/websearch/web/admin/websearchadmin.py \
     ../modules/websession/bin/inveniogc.in \
     ../modules/websession/lib/session.py \
     ../modules/websession/lib/webaccount.py \
     ../modules/websession/lib/websession_templates.py \
     ../modules/websession/lib/webuser.py \
     ../modules/websession/lib/websession_webinterface.py \
     ../modules/websession/lib/webgroup_dblayer.py \
     ../modules/websession/lib/webgroup.py \
     ../modules/websession/lib/websession_config.py \
     ../modules/webstat/bin/webstat.in \
     ../modules/webstyle/lib/template.py \
     ../modules/webstyle/lib/webpage.py \
     ../modules/webstyle/lib/webstyle_templates.py \
     ../modules/webstyle/lib/webdoc.py \
     ../modules/webstyle/lib/webdoc_tests.py \
     ../modules/webstyle/lib/webdoc_webinterface.py \
     ../modules/websubmit/lib/file.py \
     ../modules/websubmit/lib/functions/Add_Files.py \
     ../modules/websubmit/lib/functions/CaseEDS.py \
     ../modules/websubmit/lib/functions/Create_Modify_Interface.py \
     ../modules/websubmit/lib/functions/Create_Recid.py \
     ../modules/websubmit/lib/functions/Finish_Submission.py \
     ../modules/websubmit/lib/functions/Format_Record.py \
     ../modules/websubmit/lib/functions/Get_Info.py \
     ../modules/websubmit/lib/functions/Get_Report_Number.py \
     ../modules/websubmit/lib/functions/Get_Sysno.py \
     ../modules/websubmit/lib/functions/Insert_Modify_Record.py \
     ../modules/websubmit/lib/functions/Insert_Record.py \
     ../modules/websubmit/lib/functions/Is_Original_Submitter.py \
     ../modules/websubmit/lib/functions/Is_Referee.py \
     ../modules/websubmit/lib/functions/Mail_Submitter.py \
     ../modules/websubmit/lib/functions/Make_Modify_Record.py \
     ../modules/websubmit/lib/functions/Make_Record.py \
     ../modules/websubmit/lib/functions/Move_Files_Archive.py \
     ../modules/websubmit/lib/functions/Move_From_Pending.py \
     ../modules/websubmit/lib/functions/Move_to_Done.py \
     ../modules/websubmit/lib/functions/Move_to_Pending.py \
     ../modules/websubmit/lib/functions/Print_Success_APP.py \
     ../modules/websubmit/lib/functions/Print_Success_DEL.py \
     ../modules/websubmit/lib/functions/Print_Success_MBI.py \
     ../modules/websubmit/lib/functions/Print_Success.py \
     ../modules/websubmit/lib/functions/Print_Success_SRV.py \
     ../modules/websubmit/lib/functions/Report_Number_Generation.py \
     ../modules/websubmit/lib/functions/Retrieve_Data.py \
     ../modules/websubmit/lib/functions/Send_APP_Mail.py \
     ../modules/websubmit/lib/functions/Send_Approval_Request.py \
     ../modules/websubmit/lib/functions/Send_Modify_Mail.py \
     ../modules/websubmit/lib/functions/Send_SRV_Mail.py \
     ../modules/websubmit/lib/functions/Test_Status.py \
     ../modules/websubmit/lib/functions/Update_Approval_DB.py \
     ../modules/websubmit/lib/functions/Upload_Files.py \
     ../modules/websubmit/lib/websubmit_config.py \
     ../modules/websubmit/lib/websubmit_engine.py \
     ../modules/websubmit/lib/websubmit_templates.py \
     ../modules/websubmit/lib/websubmit_webinterface.py \
     ../modules/websubmit/lib/websubmitadmin_config.py \
     ../modules/websubmit/lib/websubmitadmin_engine.py \
     ../modules/websubmit/web/admin/referees.py \
     ../modules/websubmit/web/approve.py \
     ../modules/websubmit/web/publiline.py \
     ../modules/websubmit/web/yourapprovals.py \
     ../modules/websubmit/web/yoursubmissions.py \
     ../modules/websubmit/web/admin/websubmitadmin.py \
     ../modules/webjournal/lib/webjournal_utils.py \
     ../modules/webjournal/lib/webjournal_templates.py \
     ../modules/webjournal/lib/webjournal_config.py \
     ../modules/webjournal/lib/webjournaladminlib.py \
     ../modules/webjournal/web/admin/webjournaladmin.py \
     ../modules/bibcatalog/lib/bibcatalog_templates.py \
     ../modules/webjournal/lib/widgets/bfe_webjournal_widget_seminars.py \
     ../modules/webjournal/lib/widgets/bfe_webjournal_widget_whatsNew.py \
     ../modules/webjournal/lib/widgets/bfe_webjournal_widget_weather.py \
     ../modules/webjournal/lib/elements/bfe_webjournal_article_author.py \
     ../modules/webjournal/lib/elements/bfe_webjournal_imprint.py \
     ../modules/webjournal/lib/elements/bfe_webjournal_article_body.py \
     ../modules/webjournal/lib/elements/bfe_webjournal_rss.py \
     ../modules/webjournal/lib/elements/bfe_webjournal_main_navigation.py \
     ../modules/webjournal/lib/elements/bfe_webjournal_archive.py \
     ../modules/bibedit/lib/bibedit_webinterface.py \
     ../modules/bibedit/lib/bibeditmulti_templates.py \
     ../modules/bibedit/lib/bibedit_utils.py \
     ../modules/bibedit/lib/bibeditmulti_webinterface.py \
     ../modules/bibedit/lib/bibeditold_utils.py \
     ../modules/bibedit/lib/bibeditold_templates.py \
     ../modules/bibexport/lib/bibexport_method_fieldexporter_templates.py \
     ../modules/bibexport/lib/bibexport_method_fieldexporter_webinterface.py \
     ../modules/bibexport/lib/bibexport_method_fieldexporter.py \
     ../modules/bibcirculation/lib/bibcirculation_utils.py \
     ../modules/bibcirculation/lib/bibcirculation_webinterface.py \
     ../modules/bibcirculation/lib/bibcirculation_templates.py \
     ../modules/websubmit/lib/functions/Create_Upload_Files_Interface.py \
     ../modules/bibcheck/web/admin/bibcheckadmin.py \
     ../modules/bibharvest/lib/oai_repository_admin.py \
     ../modules/bibharvest/lib/oai_harvest_admin.py \
     ../modules/bibknowledge/lib/bibknowledge_templates.py \
     ../modules/bibknowledge/lib/bibknowledgeadmin.py
CATALOGS =  af.gmo bg.gmo ca.gmo cs.gmo de.gmo el.gmo en.gmo es.gmo fr.gmo hr.gmo hu.gmo gl.gmo it.gmo ja.gmo no.gmo pl.gmo pt.gmo ro.gmo ru.gmo rw.gmo sk.gmo sv.gmo uk.gmo zh_CN.gmo zh_TW.gmo

# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)

# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..

# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --language=python

# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
# package.  (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.)  Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright.  The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = CERN

# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
#   in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
#   understood.
# - Strings which make invalid assumptions about notation of date, time or
#   money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS =

# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used.  It is usually empty.
EXTRA_LOCALE_CATEGORIES =

DISTFILES.extra1 = i18n_extract_from_wml_source.py i18n_update_wml_target.py

.SUFFIXES:
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update

.po.mo:
	@echo "$(MSGFMT) -c -o $@ $<"; \
	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@

.po.gmo:
	@lang=`echo $* | sed -e 's,.*/,,'`; \
	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo

.sin.sed:
	sed -e '/^#/d' $< > t-$@
	mv t-$@ $@


all: all-yes

all-yes: stamp-po
all-no:

# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
# we don't want to bother translators with empty POT files). We assume that
# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
# In this case, stamp-po is a nop (i.e. a phony target).

# stamp-po is a timestamp denoting the last time at which the CATALOGS have
# been loosely updated. Its purpose is that when a developer or translator
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
# invocations of "make" will do nothing. This timestamp would not be necessary
# if updating the $(CATALOGS) would always touch them; however, the rule for
# $(POFILES) has been designed to not touch files that don't need to be
# changed.
stamp-po: $(srcdir)/$(DOMAIN).pot
	test ! -f $(srcdir)/$(DOMAIN).pot || \
	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
	  echo "touch stamp-po" && \
	  echo timestamp > stamp-poT && \
	  mv stamp-poT stamp-po; \
	}

# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
# otherwise packages like GCC can not be built if only parts of the source
# have been downloaded.

# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
	grep -E '(\.webdoc|\.bft)$$' $(srcdir)/POTFILES.in > POTFILES-webdoc
	grep -E '(\.in|\.py)$$' $(srcdir)/POTFILES.in > POTFILES-py

	$(PYTHON) $(srcdir)/i18n_extract_from_wml_source.py $(top_srcdir) POTFILES-webdoc > cds-invenio.po

	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
	else \
	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
	fi; \
	$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
	  --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
	  --files-from=POTFILES-py \
	  --join-existing \
	  --copyright-holder='$(COPYRIGHT_HOLDER)' \
	  --msgid-bugs-address="$$msgid_bugs_address"

	test ! -f $(DOMAIN).po || { \
	  if test -f $(srcdir)/$(DOMAIN).pot; then \
	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
	    else \
	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
	    fi; \
	  else \
	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
	  fi; \
	}

# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
# every "make" invocation, only create it when it is missing.
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
$(srcdir)/$(DOMAIN).pot:
	$(MAKE) $(DOMAIN).pot-update

# This target rebuilds a PO file if $(DOMAIN).pot has changed.
# Note that a PO file is not touched if it doesn't need to be changed.
$(POFILES): $(srcdir)/$(DOMAIN).pot
	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
	if test -f "$(srcdir)/$${lang}.po"; then \
	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
	  cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
	else \
	  $(MAKE) $${lang}.po-create; \
	fi


install: install-exec install-data
install-exec:
install-data: install-data-yes
	if test "$(PACKAGE)" = "gettext-tools"; then \
	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
	  for file in $(DISTFILES.common) Makevars.template; do \
	    $(INSTALL_DATA) $(srcdir)/$$file \
			    $(DESTDIR)$(gettextsrcdir)/$$file; \
	  done; \
	  for file in Makevars; do \
	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
	  done; \
	else \
	  : ; \
	fi
install-data-no: all
install-data-yes: all
	$(mkinstalldirs) $(DESTDIR)$(datadir)
	@catalogs='$(CATALOGS)'; \
	for cat in $$catalogs; do \
	  cat=`basename $$cat`; \
	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
	  dir=$(localedir)/$$lang/LC_MESSAGES; \
	  $(mkinstalldirs) $(DESTDIR)$$dir; \
	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
	    if test -n "$$lc"; then \
	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
	         for file in *; do \
	           if test -f $$file; then \
	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
	           fi; \
	         done); \
	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
	      else \
	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
	          :; \
	        else \
	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
	        fi; \
	      fi; \
	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
	    fi; \
	  done; \
	done

install-strip: install

installdirs: installdirs-exec installdirs-data
installdirs-exec:
installdirs-data: installdirs-data-yes
	if test "$(PACKAGE)" = "gettext-tools"; then \
	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
	else \
	  : ; \
	fi
installdirs-data-no:
installdirs-data-yes:
	$(mkinstalldirs) $(DESTDIR)$(datadir)
	@catalogs='$(CATALOGS)'; \
	for cat in $$catalogs; do \
	  cat=`basename $$cat`; \
	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
	  dir=$(localedir)/$$lang/LC_MESSAGES; \
	  $(mkinstalldirs) $(DESTDIR)$$dir; \
	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
	    if test -n "$$lc"; then \
	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
	         for file in *; do \
	           if test -f $$file; then \
	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
	           fi; \
	         done); \
	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
	      else \
	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
	          :; \
	        else \
	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
	        fi; \
	      fi; \
	    fi; \
	  done; \
	done

# Define this as empty until I found a useful application.
installcheck:

uninstall: uninstall-exec uninstall-data
uninstall-exec:
uninstall-data: uninstall-data-yes
	if test "$(PACKAGE)" = "gettext-tools"; then \
	  for file in $(DISTFILES.common) Makevars.template; do \
	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
	  done; \
	else \
	  : ; \
	fi
uninstall-data-no:
uninstall-data-yes:
	catalogs='$(CATALOGS)'; \
	for cat in $$catalogs; do \
	  cat=`basename $$cat`; \
	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
	  done; \
	done

check: all

info dvi ps pdf html tags TAGS ctags CTAGS ID:

mostlyclean:
	rm -f remove-potcdate.sed
	rm -f stamp-poT
	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
	rm -fr *.o

clean: mostlyclean

distclean: clean
	rm -f Makefile Makefile.in POTFILES *.mo

maintainer-clean: distclean
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."
	rm -f stamp-po $(GMOFILES)

distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir:
	$(MAKE) update-po
	@$(MAKE) dist2
# This is a separate target because 'update-po' must be executed before.
dist2: stamp-po $(DISTFILES)
	dists="$(DISTFILES)"; \
	if test "$(PACKAGE)" = "gettext-tools"; then \
	  dists="$$dists Makevars.template"; \
	fi; \
	if test -f $(srcdir)/$(DOMAIN).pot; then \
	  dists="$$dists $(DOMAIN).pot stamp-po"; \
	fi; \
	if test -f $(srcdir)/ChangeLog; then \
	  dists="$$dists ChangeLog"; \
	fi; \
	for i in 0 1 2 3 4 5 6 7 8 9; do \
	  if test -f $(srcdir)/ChangeLog.$$i; then \
	    dists="$$dists ChangeLog.$$i"; \
	  fi; \
	done; \
	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
	for file in $$dists; do \
	  if test -f $$file; then \
	    cp -p $$file $(distdir) || exit 1; \
	  else \
	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
	  fi; \
	done

update-po: Makefile
	$(MAKE) $(DOMAIN).pot-update
	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
	$(MAKE) update-gmo

# General rule for creating PO files.

.nop.po-create:
	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
	exit 1

# General rule for updating PO files.

.nop.po-update:
	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
	tmpdir=`pwd`; \
	echo "$$lang:"; \
	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
	echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
	cd $(srcdir); \
	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
	    rm -f $$tmpdir/$$lang.new.po; \
	  else \
	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
	      :; \
	    else \
	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
	      exit 1; \
	    fi; \
	  fi; \
	else \
	  echo "msgmerge for $$lang.po failed!" 1>&2; \
	  rm -f $$tmpdir/$$lang.new.po; \
	fi

$(DUMMYPOFILES):

update-gmo: Makefile $(GMOFILES)
	@:

Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in LINGUAS
	cd $(top_builddir) \
	  && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
	       $(SHELL) ./config.status

force:

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
